<script setup lang="ts">
import AsideCommon from '@/components/AsideCommon.vue';
import HeaderCommon from '@/components/HeaderCommon.vue';
import TapCommon from '@/components/TapCommon.vue';

import { useSidebarStore } from '@/stores/sidebar';

const sidebarStore = useSidebarStore();
</script>

<template>
  <div class="full-layout">
    <el-container class="full-height">
      <el-header class="header">
        <HeaderCommon />
      </el-header>
      <el-container class="content-full-height">
        <el-aside :width="sidebarStore.isCollapse ? '64px' : '200px'" class="sidebar">
          <AsideCommon />
        </el-aside>
        <el-main class="main">
          <TapCommon />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style scoped>
.full-layout {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.full-height {
  height: 100%;
}

.content-full-height {
  height: calc(100% - 64px);
  display: flex;
}

.header {
  background: white;
  color: #303133;
  text-align: center;
  line-height: 64px;
  padding: 0;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e4e7ed;
}

.sidebar {
  background: transparent;
  height: 100%;
  overflow: hidden;
  transition: width 0.3s ease;
}

.main {
  background-color: #f5f7fa;
  color: var(--el-text-color-primary);
  padding: 0;
  height: 100%;
  overflow: hidden;
  flex: 1;
  transition: all 0.3s ease;
}

.main-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
</style>

<style>
html,
body,
#app {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
</style>
